package com.cloud.alarm.demo.handler;


import com.cloud.alarm.dinger.core.DingerConfig;
import com.cloud.alarm.dinger.core.entity.enums.DingerType;
import com.cloud.alarm.dinger.multi.DingerConfigHandler;
import com.cloud.alarm.dinger.multi.algorithm.AlgorithmHandler;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: zhou shuai
 * @date: 2023/5/16 18:59
 * @version: v1
 */
public class DingTalkMultiHandler implements DingerConfigHandler {

    @Override
    public List<DingerConfig> dingerConfigs() {
        List<DingerConfig> dingerConfigs = new ArrayList<>();
        // 注意这里的dingerConfig根据实际情况配置
        dingerConfigs.add(
                DingerConfig.instance(DingerType.WETALK, "529d0160-66a6-4195-be89-bddd30b8bb3c")
        );
        dingerConfigs.add(
                DingerConfig.instance(DingerType.WETALK, "9110388b-e66f-4386-ac3c-6ad73f85470c")
        );
        dingerConfigs.add(
                DingerConfig.instance(DingerType.WETALK, "f91cbdbb-a850-46bb-8901-5797ab776dcc")
        );
        return dingerConfigs;
    }

    @Override
    public Class<? extends AlgorithmHandler> algorithmHandler() {
        // 使用轮询算法
        return CustomAlgorithmHandler.class;
    }

}
